/*
 * This file is part of Catfish.
 * Copyright (C) 2010 Namazu Studios LLC
 * 
 * Catfish is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of 
 * the License, or (at your option) any later version.
 * 
 * Catfish is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with Catfish.  If not, please visit:
 *  
 * http://www.gnu.org/licenses/
 *  
 */
package com.namazustudios.catfish;

/**
 * An interface to a pooled data source. The Catfish instance organizes data
 * pools on a thread local stack. When entering a scope, this can inject
 * different behavior into how the Catfish instance will interact with the data
 * store. Namely, this provides the ability to do things such as defer writes to
 * the data store or create a pool of cached data.
 * 
 * @author patricktwohig
 * 
 */
public interface StackedDataSource extends DataSource {

	/**
	 * Called when
	 * 
	 * @param catfish
	 *            the catfish instacne which is managing this pooled
	 * @param lower
	 */
	public void onPush(Catfish catfish, DataSource lower);

	/**
	 * Called when the data source is popped from the stack.
	 */
	public void onPop(Catfish catfish);

}
